/* Copyright (C) 2007 Wesley Crossman
Email: wesley@crossmans.net

Portions Copyright (C) 2007 L. Donnie Smith <wiimote@abstrakraft.org>

You can redistribute and/or modify this software under the terms of the GNU
General Public License as published by the Free Software Foundation;
either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this
program; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
Suite 330, Boston, MA 02111-1307 USA */

#ifndef WII_WINDOW_H
#define WII_WINDOW_H

#include "ui_WiiWindow.h"
#include <QMap>
#include <QTimer>
class WiiLed;
class QGraphicsScene;
class QGraphicsSvgItem;

class WiiWindow : public QMainWindow, protected Ui::WiiWindow {
Q_OBJECT
public:
    WiiWindow();
    ~WiiWindow();
    void updateButtons(int btnValue);
protected:
    QTimer buttonTimer, rumbleEffectTimer;
    bool rumbleEffectState;
    int setButtonValue;
    QGraphicsScene *scene;
    QMap < int, QGraphicsSvgItem * > buttons;
    QList < WiiLed * > leds;
    bool connectRemote();
    bool disconnectRemote();
protected slots:
    void updateButtons();
    void connectClicked();
    void disconnectClicked();
    void rumbleClicked();
    void rumbleTimeout();
    void rumbleEffectTimeout();
    void updateStatus();
    void ledToggled();
};

#endif


